<template>
  <div class="business">
    <!-- 顶部横幅 -->
    <mobilenavHeader />
    <div class="business-banner">
      <div class="banner-content">
        <h1>专属定制，打造贴合您的网站</h1>
        <h3>实现商业谋略与用户体验的和谐统一</h3>
      </div>

      <!-- 服务类别 -->
      <div class="service-categories">
        <van-grid :column-num="2" :border="false" :gutter="10">
          <van-grid-item v-for="(item, index) in categories" :key="index">
            <div class="category-item">
              <van-image
                :src="item.icon"
                width="40"
                height="40"
                fit="contain"
              />
              <p>{{ item.name }}</p>
            </div>
          </van-grid-item>
        </van-grid>
      </div>
    </div>

    <!-- 服务详情 -->
    <div class="business-content">
      <div
        v-for="(item, index) in businessItem"
        :key="index"
        class="service-card"
      >
        <van-image
          :src="item.bgImg"
          class="service-image"
          fit="cover"
          radius="8"
        />

        <div class="service-info">
          <span class="en-title">{{ item.entitle }}</span>
          <h2 class="title">{{ item.title }}</h2>
          <p class="desc">{{ item.desc1 }}</p>
          <p class="desc">{{ item.desc2 }}</p>

          <div class="feature-grid">
            <div
              v-for="(feature, fIndex) in item.descList"
              :key="fIndex"
              class="feature-item"
            >
              <van-image
                :src="feature.icon"
                width="36"
                height="36"
                fit="contain"
              />
              <span>{{ feature.name }}</span>
            </div>
          </div>
        </div>
      </div>
    </div>

    <back-top />
    <mobilebottom :backColor="'#f3f3f6'" />
  </div>
</template>

<script setup lang="ts">
import { ref, reactive } from "vue";
import mobilenavHeader from "@/components/mobilenavHeader.vue";
import mobilebottom from "@/components/mobilebottom.vue";
import BackTop from "@/components/BackTop.vue";

// 导入图片
import aiappIcon from "@/assets/img/home/aiapp.png";
import yyappIcon from "@/assets/img/home/yyapp.png";
import customIcon from "@/assets/img/home/custom.png";
import delpIcon from "@/assets/img/home/delp.png";

// 导入背景图片
import item1 from "@/assets/img/business/aiyy.png";
import item2 from "@/assets/img/business/yyxx.png";
import item3 from "@/assets/img/business/dzhkf.png";
import item4 from "@/assets/img/business/qtyy.png";

// 导入图标
import khfw from "@/assets/img/business/khfw.png";
import yygl from "@/assets/img/business/yygl.png";
import scyx from "@/assets/img/business/scyx.png";
import dmx from "@/assets/img/business/dmx.png";
import sjcj from "@/assets/img/business/sjcj.png";
import sjqx from "@/assets/img/business/sjqx.png";
import sjfx from "@/assets/img/business/sjfx.png";
import sjgl from "@/assets/img/business/sjgl.png";
import sjzt from "@/assets/img/business/sjzt.png";
import app from "@/assets/img/business/app.png";
import xcx from "@/assets/img/business/xcx.png";
import wzjs from "@/assets/img/business/wzjs.png";
import kqxt from "@/assets/img/business/kqxt.png";
import sjxt from "@/assets/img/business/sjxt.png";
import jkxt from "@/assets/img/business/jkxt.png";
import xlfx from "@/assets/img/business/xlfx.png";

const categories = reactive([
  { name: "AI企业应用", icon: aiappIcon },
  { name: "医药营销应用", icon: yyappIcon },
  { name: "定制化开发", icon: customIcon },
  { name: "其他应用", icon: delpIcon },
]);

const businessItem = reactive([
  {
    bgImg: item1,
    entitle: "-  AI Enterprise Application",
    title: "AI企业应用",
    desc1: "助力提升企业核心竞争力",
    desc2: "AI应用优化企业业务流程",
    descList: [
      { name: "客户服务", icon: khfw },
      { name: "运营管理", icon: yygl },
      { name: "市场营销", icon: scyx },
      { name: "企业大模型训练", icon: dmx },
    ],
  },
  {
    bgImg: item2,
    entitle: "-   Application of Pharmaceutical Marketing",
    title: "医药营销应用",
    desc1: "拓展市场，守护健康",
    desc2: "助推医药产品落地生根",
    descList: [
      { name: "渠道数据采集", icon: sjcj },
      { name: "渠道数据清洗", icon: sjqx },
      { name: "渠道数据分析", icon: sjfx },
      { name: "主数据管理", icon: sjgl },
    ],
  },
  {
    bgImg: item3,
    entitle: "-   Custom Development",
    title: "定制化开发",
    desc1: "精准匹配企业需求",
    desc2: "助力企业数字化转型",
    descList: [
      { name: "渠道数据中台", icon: sjzt },
      { name: "APP开发", icon: app },
      { name: "小程序开发", icon: xcx },
      { name: "网站建设", icon: wzjs },
    ],
  },
  {
    bgImg: item4,
    entitle: "-   Other Applications",
    title: "其他应用",
    desc1: "雕琢高品质数字生活",
    desc2: "铸就卓越生活品质",
    descList: [
      { name: "HR考勤汇总系统", icon: kqxt },
      { name: "审计管理系统", icon: sjxt },
      { name: "舆情监控系统", icon: jkxt },
      { name: "电商产品销量分析", icon: xlfx },
    ],
  },
]);
</script>

<style lang="scss" scoped>
.business {
  background-color: #f3f3f6;

  &-banner {
    position: relative;
    height: 100vh;
    background-image: url("@/assets/img/business/bg.png");
    background-size: cover;
    background-position: center;

    &::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(0, 0, 0, 0.3);
    }
  }
}

.banner-content {
  position: relative;
  color: #fff;
  text-align: center;
  z-index: 1;
  top: 40%;

  h1 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 12px;
  }

  h3 {
    font-size: 16px;
  }
}

.service-categories {
  position: absolute;
  bottom: 5%;
  left: 0;
  right: 0;
  z-index: 1;
  padding: 0 16px;

  :deep(.van-grid-item__content) {
    background: #a2a2a2;
  }
  .category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: #a2a2a2;
    border-radius: 8px;

    p {
      margin-top: 8px;
      color: #333;
      // color: #000;
      font-size: 14px;
    }
  }
}

.business-content {
  padding: 20px;
}

.service-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);

  .service-image {
    width: 100%;
    height: 200px;
  }

  .service-info {
    padding: 20px;

    .en-title {
      color: #666;
      font-size: 14px;
      font-weight: 500;
    }

    .title {
      font-size: 24px;
      font-weight: bold;
      color: #333;
      margin: 8px 0 16px;
    }

    .desc {
      color: #666;
      font-size: 14px;
      line-height: 1.6;
      margin-bottom: 8px;
    }
  }
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;

  .feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    span {
      margin-top: 8px;
      font-size: 12px;
      color: #666;
    }
  }
}

@media (min-width: 768px) {
  .banner-content {
    text-align: left;
    padding-left: 18%;

    h1 {
      font-size: 35px;
    }

    h3 {
      font-size: 20px;
    }
  }

  .service-categories {
    .van-grid {
      width: 70%;
      margin: 0 auto;
    }
  }

  .business-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
  }

  .service-card {
    display: flex;
    margin-bottom: 30px;

    &:nth-child(even) {
      flex-direction: row-reverse;
    }

    .service-image {
      width: 50%;
      height: auto;
    }

    .service-info {
      width: 50%;
      padding: 40px;
    }
  }

  .feature-grid {
    grid-template-columns: repeat(4, 1fr);
    margin-top: 40px;
  }
}
</style>
